/*
 * $Id: arp.h 50 2009-02-10 05:48:05Z hyunghwan.chung $
 *
   Copyright 2005-2009 Chung, Hyung-Hwan.

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an  BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
 */

#ifndef _XP_NET_ARP_H_
#define _XP_NET_ARP_H_

#include <xp/types.h>
#include <xp/macros.h>
#include <xp/net/inet.h>
#include <xp/net/ether.h>

enum xp_arp_flag_t
{
	XP_ARP_PERM = (1 << 0),
	XP_ARP_PUBL = (1 << 1)
};

#ifdef __cplusplus
extern "C" {
#endif

/*-----------------------------------*
 * ARP CACHE MANIPULATION            *
 *-----------------------------------*/
int xp_upsertarp (
	int s4, 
	const xp_char_t*     iface,
	const xp_ip4addr_t*  ipaddr,
	int                  flags,
	const xp_ethwaddr_t* hwaddr
);

int xp_deletearp (
	int                  s4, 
	const xp_char_t*     iface,
	const xp_ip4addr_t*  ipaddr,
	int                  flags
);

int xp_searcharp (
	int                  s4, 
	const xp_char_t*     iface,
	const xp_ip4addr_t*  ipaddr,
	int*                 flags,
	xp_ethwaddr_t*       hwaddr
);

#ifdef __cplusplus
}
#endif

#endif
